package uk.ac.lkl.common.allocator;



/**
 * An object that is scheduled in some way.
 * 
 * Don't need this really. Is encapsulated by ScheduleBlock.
 * 
 * @author Darren Pearce
 * @version $Revision: 356 $
 * @version $Date: 2007-10-30 16:03:32 +0000 (Tue, 30 Oct 2007) $
 * 
 */
public class ScheduleObject<O> extends ScheduleBlock<ScheduleObject<O>> {

    private O object;    

    public ScheduleObject(int start,
            int end,
            O object) {
        super(start, end);
        this.object = object;
    }   


    public O getObject() {
        return object;
    }


    // convenience method
    public ScheduleObject<O> createCopy(int start, int end) {
        // share same ref to entity
        return new ScheduleObject<O>(start, end, getObject());
    }


    public ScheduleObject<O> createCopy() {
        return createCopy(getStart(), getEnd());
    }
    
}
